<!-- $Id: brand_list.htm 15898 2009-05-04 07:25:41Z liuhui $ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<title>ECSHOP 管理中心 - 商品品牌 </title>
<base href="__ROOT__/admin/"/>
<meta name="robots" content="noindex, nofollow">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="styles/general.css" rel="stylesheet" type="text/css">
<link href="styles/main.css" rel="stylesheet" type="text/css">
<!-- <script type="text/javascript" src="js/transport.js"></script><script type="text/javascript" src="js/common.js"></script> -->
<style>
  .panel-icloud .panel-right iframe {
    height: 300px;
    margin-top: 15px;
  }
  .panel-hint{
    top: 0%;
  }
</style>

<script>
<!--
// 这里把JS用到的所有语言都赋值到这里
var process_request = "正在处理您的请求...";
var todolist_caption = "记事本";
var todolist_autosave = "自动保存";
var todolist_save = "保存";
var todolist_clear = "清除";
var todolist_confirm_save = "是否将更改保存到记事本？";
var todolist_confirm_clear = "是否清空内容？";
var no_brandname = "您必须输入品牌名称！";
var require_num = "排序序号必须是一个数字";
//-->
/*关闭按钮*/
  function get_certificate(){
	  var panel = document.getElementById('panelCloud');
	  var mask  = document.getElementById('CMask')||null;
	  var frame = document.getElementById('CFrame');
	  if(panel&&CMask&&frame){
	      panel.style.display = 'block';
	      mask.style.display = 'block';
	      frame.src = 'https://openapi.shopex.cn/oauth/authorize?response_type=code&client_id=yogfss4l&redirect_uri=http%3A%2F%2Flocalhost%2Fdayi%2Fecshop%2Fecshop%2Fadmin%2Fcertificate.php%3Fact%3Dget_certificate%26type%3Dindex&view=auth_ecshop';
	    }
	}

	/*关闭按钮*/
	function btnCancel(item){
	  var par  = item.offsetParent;
	  var mask  = document.getElementById('CMask')||null;
	  var frame = document.getElementById('CFrame');
	  par.style.display = 'none';
	  if(mask){mask.style.display = 'none';}
	  frame.src = '';
	}
</script>
</head>
<body>
<!--云起激活系统面板-->
<div class="panel-hint panel-icloud" id="panelCloud">
  <div class="panel-cross"><span onclick="btnCancel(this)">Ｘ</span></div>
  <div class="panel-title">
    <span class="tit">您需要激活系统</span>
    <p>用云起账号激活您的系统，享受物流查询，天工收银，手机短信等更多应用和服务</p>
  </div>
  <div class="panel-left">
    <span>没有云起账号吗？</span>
    <p>点击下列按钮一步完成注册激活！</p>
    <a href="https://account.shopex.cn/reg?refer=yunqi_ecshop" target="_blank" class="btn btn-yellow">免费注册云起账号</a>
  </div>
  <div class="panel-right">
    <h5 class="logo">云起</h5>
    <p>正在激活中</p>
    <!-- <iframe src="brand.html" id="CFrame" frameborder="0"></iframe> -->
    <div class="cloud-passw">
      <a target="_blank" href="https://account.shopex.cn/forget?">忘记密码？</a>
    </div>
  </div>
</div>
<!--云起激活系统面板-->
<!--遮罩-->
<div class="mask-black" id="CMask"></div>
<!--遮罩-->
<h1>
      <a class="btn btn-right" href="{:url('brand/brand_add')}">添加品牌</a>
  
    <span class="action-span1"><a href="http://localhost/dayi/ecshop/ecshop/admin/index.php?act=main">ECSHOP 管理中心</a> </span><span id="search_id" class="action-span1">&nbsp;&nbsp;&gt;&nbsp;&nbsp;商品品牌 </span>
  <div style="clear:both"></div>
</h1>
<!-- <script type="text/javascript" src="images/utils.js"></script><script type="text/javascript" src="images/listtable.js"></script> --><!-- 品牌搜索 -->
<!-- $Id: brand_search.htm 2009-05-04 liuhui $ -->
<div class="form-div">
  <form action="javascript:search_brand()" name="searchForm">
    <img src="images/icon_search.svg" alt="SEARCH" width="26" height="22" border="0">
     <input name="keyword" size="15" type="text" id="keyword">
    <input value=" 搜索 " class="button" type="button" id="serarch">
  </form>
</div>
<!-- 
<script language="JavaScript">
    function search_brand()
    {
        listTable.filter['brand_name'] = Utils.trim(document.forms['searchForm'].elements['brand_name'].value);
        listTable.filter['page'] = 1;
        
        listTable.loadList();
    }

</script> -->
<form method="post" action="" name="listForm">
<!-- start brand list -->
<div class="list-div" id="listDiv">

  <table cellspacing="1" cellpadding="3">
    <tbody><tr>
      <th>品牌名称</th>
      <th>品牌网址</th>
      <th>品牌描述</th>
      <th>排序</th>
      <th>是否显示</th>
      <th>操作</th>
    </tr>
    <tbody id="tbody">
    {volist name="data['res']" id="v"}
        <tr>
      <td class="first-cell" style="background-color: rgb(244, 250, 251);">
        <span style="float:right"><a href="http://localhost/dayi/ecshop/ecshop/data/brandlogo/1240803247838195732.gif" target="_brank"><img src="__ROOT__/uploads/{$v.brand_logo}" alt="品牌LOGO" width="16" height="16" border="0"></a></span>
        <span>{$v.brand_name}</span>
      </td>
      <td style="background-color: rgb(244, 250, 251);"><a href="http://www.philips.com.cn/" target="_brank">{$v.brand_url}</a></td>
      <td style="background-color: rgb(244, 250, 251);" align="left">{$v.brand_desc}</td>
      <td style="background-color: rgb(244, 250, 251);" align="right"><span onclick="javascript:listTable.edit(this, 'edit_sort_order', 4)">{$v.brand_order}</span></td>
      {if $v.is_show eq 1}
      <td style="background-color: rgb(244, 250, 251);" align="center"><img src="images/yes.svg" class="dian" width="20" newsdian="0" where="{$v.brand_id}"></td>
      {/if}
      {if $v.is_show eq 0}
      <td style="background-color: rgb(244, 250, 251);" align="center"><img src="images/no.svg" class="dian" width="20" newsdian="1" where="{$v.brand_id}"></td>
      {/if}

      <td style="background-color: rgb(244, 250, 251);" align="center">
        <a href="http://localhost/dayi/ecshop/ecshop/admin/brand.php?act=edit&amp;id=4" title="编辑">编辑</a> |
        <a href="{:url('brand/brand_del')}?id={$v.brand_id}">移除</a> 
      </td>
    </tr>
    {/volist}
    </tbody>
        <tr>
      <td colspan="6" style="background-color: rgb(255, 255, 255);" nowrap="true" align="right">
      <!-- $Id: page.htm 14216 2008-03-10 02:27:21Z testyang $ -->
<div id="turn-page">
  <span id="pageCurrent">1</span> / <span id="totalPages">{$data.yema.pagenum}</span>
  页，每页 <input size="3" id="pageSize" value="3"  type="text">
  条记录，总共 <span id="totalRecords">{$data.yema.count}</span>
  条记录
  <span id="page-link">
      <a href="javascript:void(0)" page="1">第一页</a>
      <a href="javascript:void(0)" page="{$data.yema.up}">上一页</a>
      <a href="javascript:void(0)" page="{$data.yema.next}">下一页</a>
      <a href="javascript:void(0)" page="{$data.yema.end}">最末页</a>
    <select id="gotoPage" >
      <option value="1" selected="selected">1</option>    
    </select>
  </span>
</div>
      </td>
    </tr>
  </tbody></table>

<!-- end brand list -->
</div>
</form>


</script>
<div id="footer">
共执行 4 个查询，用时 0.011663 秒，Gzip 已禁用，内存占用 1.384 MB<br>
版权所有 © 2005-2018 上海商派软件有限公司，并保留所有权利。</div>
<!-- 新订单提示信息 -->
<div id="popMsg">
  <table width="100%" cellspacing="0" cellpadding="0" border="0" bgcolor="#cfdef4">
  <tbody><tr>
    <td style="color: #0f2c8c" width="30" height="24"></td>
    <td style="font-weight: normal; color: #1f336b; padding-top: 4px;padding-left: 4px" width="100%" valign="center"> 新订单通知</td>
    <td style="padding-top: 2px;padding-right:2px" width="19" valign="center" align="right"><span title="关闭" style="cursor: hand;cursor:pointer;color:red;font-size:12px;font-weight:bold;margin-right:4px;" onclick="Message.close()">×</span><!-- <img title=关闭 style="cursor: hand" onclick=closediv() hspace=3 src="msgclose.jpg"> --></td>
  </tr>
  <tr>
    <td style="padding-right: 1px; padding-bottom: 1px" colspan="3" height="70">
    <div id="popMsgContent">
      <p>您有 <strong style="color:#ff0000" id="spanNewOrder">1</strong> 个新订单以及       <strong style="color:#ff0000" id="spanNewPaid">0</strong> 个新付款的订单</p>
      <p style="word-break:break-all" align="center"><a href="http://localhost/dayi/ecshop/ecshop/admin/order.php?act=list"><span style="color:#ff0000">点击查看新订单</span></a></p>
    </div>
    </td>
  </tr>
  </tbody></table>
</div>

<script src="./js/jquery-2.1.4.min.js"></script>
<script>
$(document).on('click',".dian",function(){
  var newsdian=$(this).attr('newsdian');
  var where=$(this).attr('where');
  var obj=$(this);
  $.ajax({
    url:"{:url('brand/brand_status')}",
    data:{newsdian:newsdian,where:where},
    type:'post',
    success:function(res){
      if (res==1) {
        if (newsdian==1) {
          obj.attr('src',"images/yes.svg");
          obj.attr('newsdian',0);
        }else{
          obj.attr('src',"images/no.svg");
          obj.attr('newsdian',1);
        }
      }
    }
  })
})
var data={};
    //分页
  $(document).on('click','#page-link a',function(){
        var page=$(this).attr("page");
        var url="{:url('brand/brand_list')}";
        data.page=page
        data.url=url
        getpage(data)

  })
  $(document).on('click','#serarch',function(){
    var keyword=$('#keyword').val();
      var url="{:url('brand/brand_list')}";
      data.page=1
      data.url=url
      data.keyword=keyword
      getpage(data)
  })
  function getpage(data){
            $.ajax({
            url:data.url,
            data:data,
            type:'get',
            dataType:"json",
            success:function(wawa){
               console.log(wawa)
              $("#turn-page").html('<span id="pageCurrent">'+wawa.yema.page+'</span> / <span id="totalPages">'+wawa.yema.pagenum+'</span>页，每页 <input size="3" id="pageSize" value="'+wawa.yema.pageSize+'"  type="text">条记录，总共 <span id="totalRecords">'+wawa.yema.count+'</span>条记录<span id="page-link"><a href="javascript:void(0)" page="1">第一页</a><a href="javascript:void(0)" page="'+wawa.yema.up+'">上一页</a><a href="javascript:void(0)" page="'+wawa.yema.next+'">下一页</a><a href="javascript:void(0)" page="'+wawa.yema.end+'">最末页</a><select id="gotoPage" ><option value="1" selected="selected">1</option></select></span>')  
              $("#tbody").empty();
              $.each(wawa.res,function(){
                    var tr=$('<tr></tr>');
                    tr.append('<td class="first-cell" style="background-color: rgb(244, 250, 251);"><span style="float:right"><a href="http://localhost/dayi/ecshop/ecshop/data/brandlogo/1240803247838195732.gif" target="_brank"><img src="__ROOT__/uploads/'+this.brand_logo+'" alt="品牌LOGO" width="16" height="16" border="0"></a></span><span >'+this.brand_name+'</span></td>')
                    tr.append('<td style="background-color: rgb(244, 250, 251);"><a href="http://www.philips.com.cn/" target="_brank">'+this.brand_url+'</a></td>')
                    tr.append('<td style="background-color: rgb(244, 250, 251);" align="left">'+this.brand_desc+'</td>')
                    tr.append('<td style="background-color: rgb(244, 250, 251);" align="right"><span>'+this.brand_order+'</span></td>')
                    if(this.is_show==1){
                      tr.append('<td align="center"><img src="images/yes.svg" class="dian" width="20" newsdian="0" where="'+this.brand_id+'"></td>')
                    }else{
                      tr.append('<td align="center"><img src="images/no.svg" class="dian" width="20" newsdian="1" where="'+this.brand_id+'"></td>')
                    }
                    tr.append('<td style="background-color: rgb(244, 250, 251);" align="center"><a href="http://localhost/dayi/ecshop/ecshop/admin/brand.php?act=edit&amp;id=4" title="编辑">编辑</a> |<a href="{:url("brand/brand_del")}?id='+this.brand_id+'">移除</a> </td>')
                    $("#tbody").append(tr);
            })
  }
})
  }
</script>
<!-- <script language="JavaScript">
document.onmousemove=function(e)
{
  var obj = Utils.srcElement(e);
  if (typeof(obj.onclick) == 'function' && obj.onclick.toString().indexOf('listTable.edit') != -1)
  {
    obj.title = '点击修改内容';
    obj.style.cssText = 'background-color: #eee;';
    obj.onmouseout = function(e)
    {
      this.style.cssText = '';
    }
  }
  else if (typeof(obj.href) != 'undefined' && obj.href.indexOf('listTable.sort') != -1)
  {
    obj.title = '点击对列表排序';
  }
}
<!--


var MyTodolist;
function showTodoList(adminid)
{
  if(!MyTodolist)
  {
    var global = $import("./js/global.js","js");
    global.onload = global.onreadystatechange= function()
    {
      if(this.readyState && this.readyState=="loading")return;
      var md5 = $import("js/md5.js","js");
      md5.onload = md5.onreadystatechange= function()
      {
        if(this.readyState && this.readyState=="loading")return;
        var todolist = $import("js/todolist.js","js");
        todolist.onload = todolist.onreadystatechange = function()
        {
          if(this.readyState && this.readyState=="loading")return;
          MyTodolist = new Todolist();
          MyTodolist.show();
        }
      }
    }
  }
  else
  {
    if(MyTodolist.visibility)
    {
      MyTodolist.hide();
    }
    else
    {
      MyTodolist.show();
    }
  }
}

if (Browser.isIE)
{
  onscroll = function()
  {
    //document.getElementById('calculator').style.top = document.body.scrollTop;
    document.getElementById('popMsg').style.top = (document.body.scrollTop + document.body.clientHeight - document.getElementById('popMsg').offsetHeight) + "px";
  }
}

if (document.getElementById("listDiv"))
{
  document.getElementById("listDiv").onmouseover = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
        if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#F4FAFB';
      }
    }

  }

  document.getElementById("listDiv").onmouseout = function(e)
  {
    obj = Utils.srcElement(e);

    if (obj)
    {
      if (obj.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode;
      else if (obj.parentNode.parentNode.tagName.toLowerCase() == "tr") row = obj.parentNode.parentNode;
      else return;

      for (i = 0; i < row.cells.length; i++)
      {
          if (row.cells[i].tagName != "TH") row.cells[i].style.backgroundColor = '#FFF';
      }
    }
  }

  document.getElementById("listDiv").onclick = function(e)
  {
    var obj = Utils.srcElement(e);

    if (obj.tagName == "INPUT" && obj.type == "checkbox")
    {
      if (!document.forms['listForm'])
      {
        return;
      }
      var nodes = document.forms['listForm'].elements;
      var checked = false;

      for (i = 0; i < nodes.length; i++)
      {
        if (nodes[i].checked)
        {
           checked = true;
           break;
         }
      }

      if(document.getElementById("btnSubmit"))
      {
        document.getElementById("btnSubmit").disabled = !checked;
      }
      for (i = 1; i <= 10; i++)
      {
        if (document.getElementById("btnSubmit" + i))
        {
          document.getElementById("btnSubmit" + i).disabled = !checked;
        }
      }
    }
  }

}

//-->
</script> 

</body></html>